package com.v9.system.service.impl;

import com.v9.common.core.service.DefaultService;
import com.v9.common.utils.ValuePare;
import com.v9.system.domain.Position;
import com.v9.system.mapper.PositionMapper;
import com.v9.system.service.PositionService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 岗位信息 服务层处理
 *
 * @author shilun
 */
@Service
public class PositionServiceImpl  extends DefaultService<PositionMapper, Position> implements  PositionService
{
    @Override
    public String buildTypeCode() {
        return "positionType";
    }

    @Override
    public String buildTypeName() {
        return "岗位列表";
    }

    @Override
    public List<ValuePare> buildData() {
        Position entity = new Position();
        entity.setStatus(true);
        List<ValuePare> results=new ArrayList<>();
        query(entity).forEach(item->{
            ValuePare e = new ValuePare();
            e.setId(item.getId());
            e.setLabel(item.getName());
            results.add(e);
        });
        return results;
    }
}
